package com.example.demo1103.demo4;

import java.util.function.Consumer;

public class Test {
    public static void main(String[] args) {
        Consumer<String> consumer= a-> System.out.println("这是有参但无返回值的方法"+a);
        //调用方法并且给予赋值
        fun(consumer,",没有返回值只有参数");
    }
    public static void  fun(Consumer<String> consumer,String a){
        consumer.accept(a);
    }
}